<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <script>

        var arr = [1, 2, 3, 4]
        for (var v in arr) {
            console.log(typeof v);
            console.log(v);
        }
        console.log(arr);
        let obj = {
            name: 'jack',
            age: 18,
            11: 22
        }
        console.log(obj);
        obj.class = '网络工程'
        for (var o in obj) {  //遍历对象时无序的
            console.log(typeof o);
            console.log(o);
        }
        // break continue 不能使用
        arr.forEach(
            item => {
                if (item % 2 === 0) {
                    return
                }
                console.log('item是： ', item);
            }
        )
        // Object.keys()
       
        console.log(Object.keys(obj));
        for (let aa of Object.keys(obj)) {
            console.log(aa);
        }
      var arr = [1, 2, 3, 4];
      for (var v in arr) {
        console.log(typeof v);
        console.log(v);
      }

      let obj2 = {
        name: "jack",
        age: 18,
        11: 22,
      };
      for (var o in obj2) {
        //遍历对象时无序的
        console.log(typeof o);
        // break;
        console.log(o);
      }
      // break continue 不能使用
      arr.forEach((item) => {
        if (item % 2 === 0) {
          return;
        }
        console.log("item是： ", item);
      });



    </script>
  </body>
</html>
